題目:判斷座標是否在圓形的範圍內
說明:輸入一個座標判斷這個點有沒有在半徑100的圈圈裡面
import java.util.Scanner;
public class Q3 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
int x = sc.nextInt();
int y = sc.nextInt();
System.out.println((x*x+y*y <= 10000)? "inside" : "outside");
}
}
}